import load
import hist
import numpy as np
import dataFeature

olist=load.readCsv("test.csv",False)
print(olist.shape)

# 处理数据为二维表
list=[]
for i in range(20):
    nowList=None
    for j in range(10):
        if j%2==0:  # 身高
            nowList={}
            nowList['high']=olist[i,j]
            list.append(nowList)
        else:
            nowList['weight']=olist[i,j]

# 画图
highList=[i['high'] for i in list]
weightList=[i['weight'] for i in list]
hist.draw_hist(highList,'','high','num',(150,190),(0,13))
hist.draw_hist(weightList,'','weight','num',(45,80),(0,8))

highList=np.array(highList)
weightList=np.array(weightList)
print('身高中位数：',np.median(highList))
print('体重中位数：',np.median(weightList))
print('身高标准差：',np.std(highList))
print('体重标准差：',np.std(weightList))
print('身高方差：',np.var(highList))
print('体重方差：',np.var(weightList))
print('身高极差：',np.ptp(highList))
print('体重极差：',np.ptp(weightList))
_, _, skew1, kurt1 = dataFeature.calc_stat(highList.tolist())
_, _, skew2, kurt2 = dataFeature.calc_stat(weightList.tolist())
print('身高偏度',skew1)
print('体重偏度',skew2)
print('身高峰度',kurt1)
print('体重峰度',kurt2)
